package com.spzx.product.api.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.web.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import java.util.List;

@Data
@TableName(value = "category")
@Schema(description = "商品分类")
public class Category extends BaseEntity {
    @Schema(description = "商品分类名")
    @ExcelProperty(value = "名称")
    @TableField(value = "name")
    @NotEmpty(message = "商品分类名称不能为空哦")
    private String name;
    @Schema(description = "商品图标")
    @ExcelProperty(value = "图片url")
    @TableField(value = "image_url")
    @NotEmpty(message = "商品图标不能为空哦")
    private String imageUrl;
    @Schema(description = "父类id")
    @ExcelProperty(value = "上级id")
    @TableField(value = "parent_id")
    @NotEmpty(message = "父类id不能为空哦")
    private Long parentId;
    @Schema(description = "显示状态(1显示,0不显示)")
    @TableField(value = "status")
    @ExcelProperty(value = "状态")
    @NotEmpty(message = "")
    private Short status;
    @Schema(description = "排序权值")
    @ExcelProperty(value = "排序")
    @TableField(value = "order_num")
    @NotEmpty(message = "排序权值不能为空哦")
    private Integer orderNum;
    @Schema(description = "备注")
    @ExcelIgnore
    @TableField(value = "remark")
    //@NotEmpty(message = "备注不能为空哦")
    private String remark;
    @Schema(description = "是否有子节点")
    @ExcelIgnore
    @TableField(exist = false)
    private Boolean hasChildren ;
    @Schema(description = "子节点列表")
    @ExcelIgnore
    @TableField(exist = false)
    private List<Long> childrenList ;

}
